# Maintainer: Jelle van der Waa <jelle@vdwaa.nl>
# Contributor: Joost Bremmer <toost dot b at gmail dot com>

pkgname=timew
pkgver=1.6.0
pkgrel=1
pkgdesc="Timewarrior, A command line time tracking application"
arch=('loong64' 'x86_64')
url="https://timewarrior.net/"
license=('MIT')
makedepends=('cmake' 'gcc-libs' 'asciidoctor')
optdepends=('task: Taskwarrior integration'
            'python: Holiday refresh script')
install=$pkgname.install
source=("https://github.com/GothenburgBitFactory/timewarrior/releases/download/v${pkgver}/timew-${pkgver}.tar.gz")
sha256sums=('cd1aa610ed50558bb2cf141022fa7b41523091ac3ae5fbb9c2d459cfe1afc782')

build() {
    cd "${pkgname}-${pkgver}"
    cmake -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_PREFIX=/usr .
    make
}


package() {
    cd "${pkgname}-${pkgver}"

    make DESTDIR="${pkgdir}" install

    # Install the refresh holiday scripts in /usr/bin/ for user convenience.
    chmod 755 "${pkgdir}"/usr/share/doc/timew/holidays/refresh
    ln -s /usr/share/doc/timew/holidays/refresh "${pkgdir}"/usr/bin/timew-refresh-holidays
}
